package helloworld.delegate.news;

import helloworld.exception.DuplicateNewsException;
import helloworld.admin.bean.*;
import helloworld.admin.service.news.NewsControllerService;
import helloworld.admin.service.news.NewsServiceException;
/**
 *
 * @author Tuyen-DM 
 * @version $Revision:   $ $Date: 2009/05/13  $
 */
public class NewsDelegate {

	public NewsAdminBean getNewsDetail(String newsName) throws NewsServiceException{
		NewsControllerService newsService = new NewsControllerService();
		return newsService.getNewsDetail(newsName);
	}
	
	public int createNews(NewsAdminBean news)throws NewsServiceException,DuplicateNewsException{
		NewsControllerService newsService = new NewsControllerService();
		return newsService.createNews(news);
	}
	
	public void updateNews(NewsAdminBean news)throws NewsServiceException,DuplicateNewsException{
		NewsControllerService newsService = new NewsControllerService();
		newsService.updateNews(news);
	}
	
	public void deleteNews(int id)throws NewsServiceException{
		NewsControllerService newsService = new NewsControllerService();
		newsService.deleteNews(id);
	}
}
